//
//  KWNAoutusViewController.m
//  KWNClient
//
//  Created by 张明磊 on 14/10/25.
//  Copyright (c) 2014年 张明磊. All rights reserved.
//

#import "KWLAoutusViewController.h"

@interface KWLAoutusViewController ()

@end

@implementation KWLAoutusViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self UI_aboutUS];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)UI_aboutUS{
    self.view.backgroundColor = RGB(239, 239, 244);
    
    UIView *imageView_title = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44 + IOS7_SIZE)];
    imageView_title.backgroundColor = RGB(91, 165, 229);
    [self.view addSubview:imageView_title];
    
    UIButton *button_menu = [UIButton buttonWithType:UIButtonTypeCustom];
    button_menu.frame = CGRectMake(0, IOS7_SIZE, 60, 45);
    [button_menu setImage:[UIImage imageFileName:@"button_setBack.png"] forState:UIControlStateNormal];
    button_menu.tag = 0;
    [button_menu addTarget:self action:@selector(click_aboutUS:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button_menu];
    
    UILabel *label_title = [[UILabel alloc] initWithFrame:CGRectMake(imageView_title.frame.origin.x,IOS7_SIZE + 5,imageView_title.frame.size.width,35)];
    label_title.backgroundColor = [UIColor clearColor];
    label_title.textColor = [UIColor whiteColor];
    label_title.textAlignment = NSTextAlignmentCenter;
    label_title.font = [UIFont fontWithName:@"Helvetica-Bold" size:16.0f];
    [self.view addSubview:label_title];
    label_title.text = @"关于我们";

    UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)];
    imageview.hidden = NO;
    imageview.image = [UIImage imageFileName:@"aboutus_1-3-2.png"];
    imageview.contentMode =  UIViewContentModeCenter;
    [self.view insertSubview:imageview atIndex:0];
    
    UIImageView *imageView_icon = [[UIImageView alloc] initWithFrame:CGRectMake(60, MainScreenHeight - 56 - 82, 56, 56)];
    imageView_icon.image = [UIImage imageFileName:@"set_icon.png"];
    [self.view addSubview:imageView_icon];

    UIImageView *image_app_name = [[UIImageView alloc] initWithFrame:CGRectMake(imageView_icon.frame.origin.x + 10 + imageView_icon.frame.size.width, imageView_icon.frame.origin.y + 5, 145, 18)];
    image_app_name.image = [UIImage imageFileName:@"image_app_name.png"];
    [self.view addSubview:image_app_name];

    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
//    NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"];
    NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
    UILabel *label_version = [[UILabel alloc] initWithFrame:CGRectMake(image_app_name.frame.origin.x, imageView_icon.frame.origin.y + imageView_icon.frame.size.height - 20, 200, 20)];
    label_version.backgroundColor = [UIColor clearColor];
    label_version.text = [NSString stringWithFormat:@"%@ for iPhone",app_Version];
    label_version.textColor = [UIColor whiteColor];
    label_version.textAlignment = NSTextAlignmentLeft;
    label_version.font = [UIFont fontWithName:@"Helvetica-Bold" size:11.0f];
    [self.view addSubview:label_version];
    
    UILabel *label_zhujie = [UIUtils creatLabel];
    label_zhujie.font = FontOfSystem(11);
    label_zhujie.frame = CGRectMake(0, MainScreenHeight - 50, MainScreenWidth, 20);
    label_zhujie.textAlignment = NSTextAlignmentCenter;
    label_zhujie.textColor = RGB(204, 183, 158);
    label_zhujie.text = @"copyright©2015 kuaifawu.com All rights reserved.";
    [self.view addSubview:label_zhujie];

}

- (void)click_aboutUS:(UIButton *)button{
    [self popViewController];
}

@end
